package com.jt.web.controller;

import com.jt.pojo.Content;
import com.jt.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author dc
 * @Classname WebContentController
 * @Date 2020/3/24 16:40
 */
@RestController
@RequestMapping("/web/content")
public class WebContentController {

    @Autowired
    ContentService contentService;

    /**
     * 使用httpClient进行广告展示
     * @param contentCategoryId
     * @return
     */
    @RequestMapping("/list/{contentCategoryId}")
    public List<Content> findContentListByCategoryId(@PathVariable Long contentCategoryId){
        List<Content> contentByCatId = contentService.findContentByCatId(contentCategoryId);
        return contentByCatId;
    }
}
